<template>
	<uni-swiper-dot :info="props.images" :current="current" field="content" :mode="mode"
		:dotsStyles="{selectedBackgroundColor:'#fff'}">
		<swiper class="swiper-box" @change="change">
			<swiper-item v-for="(item ,index) in props.images" :key="index">
				<view class="swiper-item">
					<image class="pic" :src="item" />
				</view>
			</swiper-item>
		</swiper>
	</uni-swiper-dot>
</template>

<script setup lang="ts">
	import { ref } from 'vue'
	const props = defineProps<{
		images ?: Array<string>
	}>()
	let current = ref<number>(0)
	let mode = ref<string>('default')

	const change = (e : any) => {
		// console.log(e)
		current.value = e.detail.current;
	}
</script>

<style lang="scss" scoped>
	::v-deep .uni-swiper__dots-item {
		border-radius: 50px !important;
	}

	::v-deep .uni-swiper__dots-box {
		left: auto !important;
		right: 5% !important;
	}

	::v-deep .swiper-box {
		height: 680px !important;
	}

	.swiper-item {
		color: #fff;
	}

	.pic {
		width: 100%;
		height: 680px;
	}

	.custom-indicator {
		position: absolute;
		right: 5px;
		bottom: 5px;
		padding: 2px 5px;
		font-size: 12px;
		background: rgba(255, 255, 255, 0.5);
	}
</style>